$(function () {
    window.onload = onload666()

})

function onload666() {
    $.ajax({
        type: "get",
        url: "http://localhost:10000/user/usemingxi.do",
        success: function (data) {
            for (let i = 0; i < data.length; i++) {
                $("#cangku_button").append("<input type='button' onclick='button33(this.value)' value='"+data[i].storeName+"'>&nbsp")
            }
        }
    })
}

function button33(a) {
    $.ajax({
        type: "get",
        url: "http://localhost:10000/user/usexiangqing.do",
        dataType:"json",
        data: "storeID=" + a,
        success: function (data) {
            $("#cangku_mingxi").html("")
            for (let i = 0; i < data.length; i++) {
                if (data[i].siteID != b){
                    $("#cangku_mingxi").append("<br>")
                }
                if (data[i].trayState == '1'){
                    $("#cangku_mingxi").append("<span style='color: red'>"+data[i].trayID+"</span>&nbsp")
                }else {
                    $("#cangku_mingxi").append("<span>"+data[i].trayID+"</span>&nbsp")
                }
                var b = data[i].siteID
            }
        }
    })
}
